<template>
  <div class="breadcumb">
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="item.path" v-for="(item,index) in list" :key="index">{{item.meta.title}}</el-breadcrumb-item>

    </el-breadcrumb>
  </div>
</template>
<script>
export default {
  data(){
    return {
      list:[]
    }
  },
  watch: {
    $route(){
      this.getBreadcrumb()
    }
  },
  created(){
    this.getBreadcrumb()
  },
  methods:{
    getBreadcrumb() {
      let matched = this.$route.matched.filter(
        item => item.meta && item.meta.title
      );
      this.list = matched
    }
  }
}
</script>
<style scoped>
.breadcumb {
  float: left;
}
.breadcumb ul li {
  display: inline-block;
}
.breadcumb ul li span {
  padding: 0 5px;
}
.el-breadcrumb__separator{
  color: #fff!important;
}

</style>